#pragma once

#include "Game/Process/RenderProcess.h"
#include "Render/Texture/Picture2DTexture.h"
#include "Render/Texture/CustomTexture.h"
#include "Render/Texture/RenderTarget.h"
#include "Render/Tradition/RHIRenderPass.h"
#include "Render/Tradition/GraphicsPipeline.h"
#include "Render/Texture/ColorRenderTarget.h"
#include "Render/Texture/DepthRenderTarget.h"
#include "Render/Shader/RHIDescriptor.h"
#include "Render/Tradition/RHIFramebuffer.h"

class LocalEntity;

class TextureProcess : public RenderProcess
{
	DECLARE_PROCESS(TriangleProcess)

	struct UboBase
	{
		glm::mat4 model;
		glm::mat4 view;
		glm::mat4 proj;
	};

	struct VertexPosTexCoord {
		glm::vec3 pos;
		glm::vec2 texCoord;
	};

protected:

	virtual void OnInit() override;

	virtual void OnTick(float deltaTime) override;

	virtual void OnResize() override;

protected:

	RefCountPtr<RHIDescriptor> mDescriptor;

	RefCountPtr<GraphicsPipeline> mPipeline;

	RefCountPtr<RHIRenderPass> mRenderPass;

	RefCountPtr<RHIFrameBuffer> mFrameBuffer;

	RefCountPtr<ColorRenderTarget> mColorRenderTarget;

	RefCountPtr<DepthRenderTarget> mDepthRenderTarget;

	RefCountPtr<RHITexture> mLeftTexture;

	RefCountPtr<RHITexture> mRightTexture;

	RefCountPtr<RHISampler> mSampler;

	std::vector<LocalEntity*> mLocalEntitys;
};
